package org.feign.demo.controller;

import org.feign.demo.dao.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: jack
 * \* Date: 2019/1/24
 * \* Time: 15:24
 * \* Description:
 * \
 */
@RestController
public class HelloController {
    @Autowired
    HelloService helloService; //编译器报错，无视。 因为这个Bean是在程序启动的时候注入的，编译器感知不到，所以报错。

    @GetMapping("/feign/hello/{requestName}")
    public String sayHello(@PathVariable("requestName") String requestName){
        return helloService.sayHello(requestName);
    }
}
